<?xml version="1.0" encoding="windows-1250"?>
<gxsl:stylesheet xmlns:gxsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/TransformAlias" xml:space="default">
  <gxsl:namespace-alias stylesheet-prefix="xsl" result-prefix="gxsl"/>
  <gxsl:output method="xml" encoding="windows-1250" indent="yes" cdata-section-elements="gxsl:comment"/>

  <gxsl:include href="utils.xsl"/>

  <gxsl:param name="cvincludepage"/>
  <gxsl:param name="cvinclude" select="$cvincludepage/.."/>
  <gxsl:param name="lang">cs</gxsl:param>

  <gxsl:template match="/">
    <xsl:stylesheet version="1.0">
      <xsl:output method="html" indent="no" encoding="windows-1250"/>
      <gxsl:apply-templates select="$cvinclude"/>
    </xsl:stylesheet>
  </gxsl:template>

  <gxsl:template match="CVInclude[@create='1']">
    <gxsl:variable name="dict" select="document('dictionary.xml')/Translation"/>

      <xsl:template match="DPEdit">

        <script language="JavaScript" type="text/javascript" src="{{/DPOutput/@cpath}}/sta/{{/DPOutput/@repository}}/fnc/mambo.js"/>
        <script language="JavaScript" type="text/javascript">
          <xsl:comment>
            <![CDATA[
              function check()
              {

                var form = document.forms.edit; ]]>
                <gxsl:for-each select="CVIProperties/CVIProperty[PropGroup/@create='1' and @oncreate='show']">
                        <gxsl:choose>
                          <gxsl:when test="@type='int'">
                            if (!valInt(form.<gxsl:value-of select="@formcode"/>,"<gxsl:value-of select="Title"/>")) return false;
                          </gxsl:when>
                          <gxsl:when test="@type='float'">
                            if (!valFloat(form.<gxsl:value-of select="@formcode"/>,"<gxsl:value-of select="Title"/>")) return false;
                          </gxsl:when>
                          <gxsl:when test="@type='date'">
                            if (!valDate(form.<gxsl:value-of select="@formcode"/>,"<gxsl:value-of select="Title"/>","ISO")) return false;
                          </gxsl:when>
                          <gxsl:when test="@type='datetime'">
                            if (!valDate(form.<gxsl:value-of select="@formcode"/>,"<gxsl:value-of select="Title"/>","ISOHms")) return false;
                          </gxsl:when>
                          <gxsl:when test="@type='timestamp'">
                            if (!valDate(form.<gxsl:value-of select="@formcode"/>,"<gxsl:value-of select="Title"/>","ISOHms")) return false;
                          </gxsl:when>
                          <gxsl:when test="@type='varchar' or @type='char'">
                            if (!length(form.<gxsl:value-of select="@formcode"/>, <gxsl:value-of select="@len"/>, "<gxsl:value-of select="Title"/>")) return false;
                          </gxsl:when>
                        </gxsl:choose>
                </gxsl:for-each>

            <![CDATA[

                return true;
              }

              function changed()
              {
                var form = document.forms.edit;
                form.apply.disabled=true;
                ]]>
                  <gxsl:for-each select="CVIProperties/CVIProperty[PropGroup/@create='1' and @oncreate='show' and @mandat='1']">
                    if (form.<gxsl:value-of select="@formcode"/>.value=='' || form.<gxsl:value-of select="@formcode"/>.value==' ') return;
                  </gxsl:for-each>
                  <gxsl:if test="@create='1'">
                    form.apply.disabled=false;
                  </gxsl:if>
                <![CDATA[
              }

            ]]>
          //</xsl:comment>
        </script>


        <form method="post" name="edit" onsubmit="return compute()">
          <xsl:attribute name="action">
            <xsl:text>?</xsl:text>
            <gxsl:for-each select="ancestor-or-self::CVInclude/../CVIRBindings/CVIRBinding">
              <gxsl:if test="not(../../CVInclude/Keys/Binding[@property=current()/@p2])">
                <gxsl:if test="position()!=1"><xsl:text>&amp;</xsl:text></gxsl:if><xsl:text><gxsl:value-of select="@p2"/>=</xsl:text><xsl:value-of select="../DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}"/>
              </gxsl:if>
            </gxsl:for-each>
            <gxsl:for-each select="ancestor::CVInclude/Keys/Binding">
              <gxsl:variable name="property"><gxsl:value-of select="@property"/></gxsl:variable>
              <gxsl:if test="not(../../CVIRels/CVIRel[descendant-or-self::CVInclude/@id_cvinclude=$cvinclude/@id_cvinclude]/CVIRBindings/CVIRBinding[@p1=$property])">
                <xsl:text>&amp;<gxsl:value-of select="@property"/>=</xsl:text><xsl:value-of select="../DPNavig/{../../@conceptcoll}/{../../@concept}/@{@propertylow}"/>
              </gxsl:if>
            </gxsl:for-each>
          </xsl:attribute>

          <input type="hidden" name="dp" value=""/>
          <input type="hidden" name="dpno" value="{@id_cvinclude}"/>
          <input type="hidden" name="collsize" value="0"/>

          <gxsl:for-each select="Schedules/InsertSchedule/SchedItem">
            <input type="hidden" name="{@path}s"/>
          </gxsl:for-each>

          <input type="hidden" name="ssnctl"/>
          <table cellpadding="3" cellspacing="0" border="0">
            <tr>
              <td colspan="2">
                <font size="+1"><b>
                  <gxsl:value-of select="CVITitles/CVITitle[@id_cttype='createtitle']/Title"/>
                </b></font><br/>
                <xsl:text disable-output-escaping="yes"><gxsl:value-of select="CVITitles/CVITitle[@id_cttype='createtitle']/Descr"/></xsl:text>
              </td>
            </tr>
            <tr>
              <td colspan="2">

                <xsl:call-template name="createform"/>

              </td>
            </tr>
            <tr>
              <td align="left">
                <gxsl:if test="name(..)='CView' and @allowxml='1'">
                  <a class="text">
                  <xsl:attribute name="href">?dp=crtxml</xsl:attribute>
                  <gxsl:value-of select="$dict/Text[@tid='crt_from_xml']/Value[@lang=$lang]"/>
                  </a>
                </gxsl:if>
                &#160;
              </td>
              <td align="right">
                <gxsl:if test="@insertcoll='1' and CVIProperties/CVIProperty[@key='1' and @cntr='1']">
                  <script language="JavaScript" type="text/javascript">
                    <xsl:comment>
                      <![CDATA[
                        function checkTotalField() {
                          var f = document.forms.edit.total;
                          if (f.value == '') return;
                          if (isNaN(parseInt(f.value, 10)) || (parseInt(f.value, 10) < 1)) {
                            f.value = 1;
                          } else {
                            f.value = parseInt(f.value, 10);
                          }
                        }
                      ]]>
                    //</xsl:comment>
                  </script>
                  <input type="text" name="total" size="1" value="1" onkeyup="javascript:checkTotalField();"/>
                </gxsl:if>

                <script language="JavaScript" type="text/javascript">
                  <xsl:comment>
                    <![CDATA[
                      function compute() {
                        if (!check()) return false;
                        var form = document.edit;
                        form.collsize.value = '0';
                        ]]><gxsl:for-each select="Schedules/InsertSchedule/SchedItem"><![CDATA[
                        form.]]><gxsl:value-of select="@path"/><![CDATA[s.value = "<]]><gxsl:value-of select="@concept"/>s<![CDATA[>";
                        ]]></gxsl:for-each>

                        <gxsl:for-each select="CVIProperties/CVIProperty[PropGroup/@create='1' and @oncreate='show' and @fetchtype='external' and @ref!='' and @extwork and @extwork!='']"><![CDATA[
                          var a]]><gxsl:value-of select="position()"/><![CDATA[ = form.]]><gxsl:value-of select="@formcode"/><![CDATA[xarray.value.split(",");]]>
                        </gxsl:for-each>

                        <gxsl:for-each select="CVIProperties/CVIProperty[PropGroup/@create='1' and @oncreate='show' and @fetchtype='external' and @ref!='' and @extwork and @extwork!='']"><![CDATA[
                          for (i]]><gxsl:value-of select="position()"/><![CDATA[ = 0; i]]><gxsl:value-of select="position()"/><![CDATA[ < a]]><gxsl:value-of select="position()"/><![CDATA[.length; i]]><gxsl:value-of select="position()"/><![CDATA[++) {]]>
                        </gxsl:for-each>

                        <gxsl:for-each select="CVIProperties/CVIProperty[PropGroup/@create='1' and @oncreate='show' and @fetchtype='external' and @ref!='' and @extwork and @extwork!='']"><![CDATA[
                          form.]]><gxsl:value-of select="@formcode"/><![CDATA[.value = a]]><gxsl:value-of select="position()"/><![CDATA[[i]]><gxsl:value-of select="position()"/><![CDATA[];]]>
                        </gxsl:for-each><![CDATA[

                        computeElement();]]>
                        form.collsize.value = parseInt(form.collsize.value) + 1;

                        <gxsl:for-each select="CVIProperties/CVIProperty[PropGroup/@create='1' and @oncreate='show' and @fetchtype='external' and @ref!='' and @extwork and @extwork!='']">
                          }
                        </gxsl:for-each>

                        <gxsl:for-each select="Schedules/InsertSchedule/SchedItem"><![CDATA[
                        form.]]><gxsl:value-of select="@path"/><![CDATA[s.value = form.]]><gxsl:value-of select="@path"/><![CDATA[s.value + "</]]><gxsl:value-of select="@concept"/>s<![CDATA[>";
                        ]]></gxsl:for-each>

                        if (form.collsize.value == 1) {
                          form.dp.value = "insert" + form.dpno.value;
                        } else {
                          form.dp.value = "insertcoll" + form.dpno.value;
                        }

                        return true;

                        <![CDATA[
                      }

                      function computeElement() {
                        var form = document.edit;
                        var h;]]>
                        <gxsl:for-each select="Schedules/InsertSchedule/SchedItem"><![CDATA[
                          var f = form.]]><gxsl:value-of select="@path"/><![CDATA[s;
                          f.value += "<]]><gxsl:value-of select="@concept"/><![CDATA[";]]>
                          <gxsl:variable name="concept" select="@concept"/>
                          <gxsl:for-each select="../../../CVIProperties/CVIProperty[PropGroup/@create='1' and (@oncreate!='hide' or @key='1' or @mandat='1' or ../../../CVIRBindings/CVIRBinding/@p2low=@simplenamelow) and @concept=$concept and @attr='1']">
                            <gxsl:choose>
                              <gxsl:when test="(@type!='boolean' and @type!='boolean_txt') or @mandat='1'"><![CDATA[
                                h = form.]]><gxsl:value-of select="@formcode"/><![CDATA[.value;
                                h = h.replace(/&/g,'&amp;');
                                h = h.replace(/</g,'&lt;');]]>
                              </gxsl:when>
                              <gxsl:otherwise><![CDATA[
                                if (form.]]><gxsl:value-of select="@formcode"/><![CDATA[.length == 3 && form.]]><gxsl:value-of select="@formcode"/><![CDATA[[2].checked) {
                                  h = "";
                                } else {
                                  if (form.]]><gxsl:value-of select="@formcode"/><![CDATA[[0].checked) {]]>
                                   <gxsl:choose>
                                     <gxsl:when test="@type='boolean'"><![CDATA[
                                    h = 1;
                                  } else {
                                    h = 0;]]>
                                     </gxsl:when>
                                     <gxsl:otherwise><![CDATA[
                                    h = true;
                                  } else {
                                    h = false;]]>
                                     </gxsl:otherwise>
                                   </gxsl:choose><![CDATA[
                                  }
                                }]]>
                              </gxsl:otherwise>
                            </gxsl:choose><![CDATA[
                            f.value += " ]]><gxsl:value-of select="@nicknamelow"/><![CDATA[=\"" + h + "\"";]]>
                          </gxsl:for-each><![CDATA[
                            f.value += ">";]]>
                          <gxsl:for-each select="../../../CVIProperties/CVIProperty[PropGroup/@create='1' and (@oncreate!='hide' or @key='1' or @mandat='1' or ../../../CVIRBindings/CVIRBinding/@p2=@simplename) and @concept=$concept and @attr='0']">
                            <gxsl:choose>
                              <gxsl:when test="(@type!='boolean' and @type!='boolean_txt') or @mandat='1'"><![CDATA[
                                h = form.]]><gxsl:value-of select="@formcode"/><![CDATA[.value;
                                h = h.replace(/&/g,'&amp;');
                                h = h.replace(/</g,'&lt;');]]>
                              </gxsl:when>
                              <gxsl:otherwise><![CDATA[
                                if (form.]]><gxsl:value-of select="@formcode"/><![CDATA[.length == 3 && form.]]><gxsl:value-of select="@formcode"/><![CDATA[[2].checked) {
                                  h = "";
                                } else {
                                  if (form.]]><gxsl:value-of select="@formcode"/><![CDATA[[0].checked) {]]>
                                   <gxsl:choose>
                                     <gxsl:when test="@type='boolean'"><![CDATA[
                                    h = 1;
                                  } else {
                                    h = 0;]]>
                                     </gxsl:when>
                                     <gxsl:otherwise><![CDATA[
                                    h = true;
                                  } else {
                                    h = false;]]>
                                     </gxsl:otherwise>
                                   </gxsl:choose><![CDATA[
                                  }
                                }]]>
                              </gxsl:otherwise>
                            </gxsl:choose><![CDATA[
                            f.value += "<]]><gxsl:value-of select="@nickname"/><![CDATA[>" + h + "</]]><gxsl:value-of select="@nickname"/><![CDATA[>";]]>
                          </gxsl:for-each><![CDATA[
                          f.value += "</]]><gxsl:value-of select="@concept"/><![CDATA[>";]]>
                        </gxsl:for-each><![CDATA[
                      }
                    ]]>
                  //</xsl:comment>
                </script>

                <gxsl:variable name="title"><xsl:value-of select="CVITitles/CVITitle[@id_cttype='createbutton']/Title"/></gxsl:variable>
                <gxsl:choose>
                  <gxsl:when test="not($title) or $title=''">
                    <input name="apply" disabled="true" type="submit" class="input_button"><gxsl:attribute name="value"><gxsl:value-of select="$dict/Text[@tid='crt']/Value[@lang=$lang]"/></gxsl:attribute></input>
                  </gxsl:when>
                  <gxsl:otherwise>
                    <input name="apply" disabled="true" type="submit" class="input_button" value="{$title}"/>
                  </gxsl:otherwise>
                </gxsl:choose>
              </td>
            </tr>
            <tr>
              <td colspan="2" align="right" class="text">
                <nobr>
                  <gxsl:if test="count(CVIStyles/CVIStyle[Style/StyleType/@name='create'])&gt;1">
                    <gxsl:for-each select="CVIStyles/CVIStyle[Style/StyleType/@name='create']">
                      <xsl:choose>
                        <xsl:when>
                          <gxsl:attribute name="test">@style=<gxsl:value-of select="position()"/></gxsl:attribute>
                          <gxsl:value-of select="Style/StyleTitles/StyleTitle[@id_lang=$lang]/Title"/>
                          <gxsl:if test="position()!=last()">&#160;|&#160;</gxsl:if>
                        </xsl:when>
                        <xsl:otherwise>
                          <a>
                            <xsl:attribute name="href">
                            <gxsl:choose>
                              <gxsl:when test="name(..)!='CView'">
                                <xsl:text>?dp=create</xsl:text><gxsl:value-of select="../../@id_cvinclude"/>
                                  <gxsl:for-each select="../../../CVIRBindings/CVIRBinding">&amp;<gxsl:value-of select="@p2"/>=<xsl:value-of select="../DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p2low}"/></gxsl:for-each>
                                  <gxsl:for-each select="../../ancestor::CVInclude/../CVIRBindings/CVIRBinding"><gxsl:if test="not(../../CVInclude/Keys/Binding[@property=current()/@p2])">&amp;<gxsl:value-of select="@p2"/>=<xsl:value-of select="../DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}"/></gxsl:if></gxsl:for-each>
                                  <gxsl:for-each select="../../ancestor::CVInclude/Keys/Binding">
                                    <gxsl:variable name="property"><gxsl:value-of select="@property"/></gxsl:variable>
                                    <gxsl:if test="not(../../CVIRels/CVIRel[descendant-or-self::CVInclude/@id_cvinclude=$cvinclude/@id_cvinclude]/CVIRBindings/CVIRBinding[@p1=$property])">
                                      <xsl:text>&amp;<gxsl:value-of select="@property"/>=</xsl:text><xsl:value-of select="../DPNavig/{../../@conceptcoll}/{../../@concept}/@{@propertylow}"/>
                                    </gxsl:if>
                                  </gxsl:for-each>&amp;style=<gxsl:value-of select="position()"/>
                              </gxsl:when>
                              <gxsl:otherwise>
                                <xsl:text>?dp=create<gxsl:value-of select="../../@id_cvinclude"/>&amp;style=<gxsl:value-of select="position()"/></xsl:text>
                              </gxsl:otherwise>
                            </gxsl:choose>
                            </xsl:attribute>
                            <gxsl:value-of select="Style/StyleTitles/StyleTitle[@id_lang=$lang]/Title"/>
                          </a><gxsl:if test="position()!=last()">&#160;|&#160;</gxsl:if>
                        </xsl:otherwise>
                      </xsl:choose>
                    </gxsl:for-each>
                  </gxsl:if>
                </nobr>
              </td>
            </tr>
          </table>
        </form>

        <script language="JavaScript" type="text/javascript">
          <xsl:comment>
            <![CDATA[
              changed();
            ]]>
          //</xsl:comment>
        </script>

      </xsl:template>


      <xsl:template name="createform">
        <xsl:variable name="ulevel" select="/DPOutput/BS_Person/ulevel"/>

      <table cellpadding="2" cellspacing="0" border="0" width="100%">
      <gxsl:for-each select="CVIProperties/CVIProperty[PropGroup/@create='1']">

        <tr><td valign="top" align="right">

        <gxsl:variable name="lenvis">
          <gxsl:choose>
            <gxsl:when test="not(@lenvisible)">
              <gxsl:choose>
                <gxsl:when test="(@len &gt;= 1) and (@len &lt;= 66)">
                  <gxsl:value-of select="@len"/>
                </gxsl:when>
                <gxsl:otherwise>
                  <gxsl:value-of select="66"/>
                </gxsl:otherwise>
              </gxsl:choose>
            </gxsl:when>
            <gxsl:otherwise>
              <gxsl:choose>
                <gxsl:when test="@lenvisible &gt;= 1">
                  <gxsl:value-of select="@lenvisible"/>
                </gxsl:when>
                <gxsl:otherwise>
                  <gxsl:value-of select="66"/>
                </gxsl:otherwise>
              </gxsl:choose>
            </gxsl:otherwise>
          </gxsl:choose>
        </gxsl:variable>

        <gxsl:variable name="default">
          <gxsl:choose>
            <gxsl:when test="(not(@defaulttype) or @defaulttype!='ext') and @type!='file'">
              <gxsl:value-of select="@default"/>
            </gxsl:when>
            <gxsl:otherwise>
              <gxsl:value-of select="''"/>
            </gxsl:otherwise>
          </gxsl:choose>
        </gxsl:variable>

        <gxsl:choose>
          <gxsl:when test="@oncreate='show' and number(@len)>50 and @type!='url'">
            <span>
              <gxsl:call-template name="tooltip"><gxsl:with-param name="title" select="Title"/><gxsl:with-param name="desc" select="Descr"/></gxsl:call-template>
              <b>
                <font size="-1">
                  <nobr><gxsl:value-of select="Title"/>:<gxsl:if test="@mandat='1' and @type!='boolean' and @type!='boolean_txt'"><span class="mandat" title="{$dict/Text[@tid='mandat_tooltip']/Value[@lang=$lang]}"> * </span></gxsl:if></nobr>
                </font>
              </b>
            </span>
            <gxsl:if test="Descr and Descr!=''">
              <xsl:if test="$ulevel='beg'">
                <br/>
                <font size="-2">
                  <gxsl:value-of select="Descr"/>
                </font>
              </xsl:if>
            </gxsl:if>
            <gxsl:text disable-output-escaping="yes">&lt;/td&gt;&lt;td valign="top"&gt;</gxsl:text>
            <gxsl:choose>
<!--
              <gxsl:when test="@type='xhtml'">
       					<textarea name="{@formcode}" onkeyup='changed();'><gxsl:value-of select="$default"/></textarea>
              	<script type="text/javascript" src="{{/DPOutput/@cpath}}/sta/{{/DPOutput/@repository}}/fckeditor/fckeditor.js"></script>
            		<script type="text/javascript">
                  <![CDATA[<! - -]]>
                  var oFCKeditor = new FCKeditor( '<gxsl:value-of select="@formcode"/>', 840, 450) ;
                  oFCKeditor.BasePath	= '<xsl:value-of select="/DPOutput/@cpath"/>/sta/<xsl:value-of select="/DPOutput/@repository"/>/fckeditor/';  
                  oFCKeditor.Config["BaseHref"] = '<xsl:value-of select="/DPOutput/@curl"/>/sta/<xsl:value-of select="/DPOutput/@model"/>/';
                  oFCKeditor.Config["CustomConfigurationsPath"] = "../myconfig.js";
                  oFCKeditor.ReplaceTextarea();
                  <![CDATA[//- - >]]>
                </script>
              </gxsl:when>    
-->
              <gxsl:when test="@numrows=1">
                <input class="input_field" type="text" name="{@formcode}" value="{$default}" size="{$lenvis}" onkeyup='changed();'/>
              </gxsl:when>

              <gxsl:when test="@numrows>1">
                <textarea rows="{@numrows}" name="{@formcode}" onkeyup='changed();'>
                  <gxsl:attribute name="cols">
                    <gxsl:choose>
                      <gxsl:when test="@lenvisible and @lenvisible!=''"><gxsl:value-of select="@lenvisible"/></gxsl:when>
                      <gxsl:otherwise>50</gxsl:otherwise>
                    </gxsl:choose>
                  </gxsl:attribute>
                  <gxsl:value-of select="$default"/>
                </textarea>
              </gxsl:when>

              <gxsl:otherwise>
                <textarea rows="3" name="{@formcode}" onkeyup='changed();'>
                  <gxsl:attribute name="cols">
                    <gxsl:choose>
                      <gxsl:when test="@lenvisible and @lenvisible!=''"><gxsl:value-of select="@lenvisible"/></gxsl:when>
                      <gxsl:otherwise>50</gxsl:otherwise>
                    </gxsl:choose>
                  </gxsl:attribute>
                </textarea>
                <gxsl:value-of select="$default"/>
              </gxsl:otherwise>
            </gxsl:choose>

            <gxsl:if test="@extwork!='' and @fetchtype='external'">
              <input type="button" class="input_button"><gxsl:attribute name="value"><gxsl:value-of select="$dict/Text[@tid='select']/Value[@lang=$lang]"/></gxsl:attribute>
                <gxsl:attribute name="onclick">add<gxsl:value-of select="position()"/>();</gxsl:attribute>
              </input>

              <gxsl:variable name="position"><gxsl:value-of select="position()"/></gxsl:variable>

              <script language="JavaScript" type="text/javascript">
                <xsl:comment>
                  <![CDATA[
                    function add]]><gxsl:value-of select="position()"/><![CDATA[()
                    {
                      var f=document.edit;
                      var path="../]]><xsl:value-of select="substring-before(/DPOutput/@package,'.')"/>.<gxsl:value-of select="@extwork"/>/?select=<gxsl:value-of select="@formcode"/>&amp;ssnctl=hdrext&amp;allowmulti=0<![CDATA[";
                      var sFeatures = "dependent=yes,toolbar=no,scrollbars=yes,location=no,status=no,resizable=yes,height="+document.body.clientHeight+",width="+document.body.clientWidth+",top="+window.screenTop+",left="+window.screenLeft;
                      window.open(path,"external",sFeatures);
                    }

                    function ]]><gxsl:value-of select="@formcode"/><![CDATA[(key, dummy)
                    {
                      var f=document.edit;
                      f.]]><gxsl:value-of select="@formcode"/><![CDATA[.value=key;
                      f.ssnctl.value="hdrnrm";
                      changed();
                      window.focus();
                    }
                  ]]>
                //</xsl:comment>
              </script>
            </gxsl:if>

          </gxsl:when>
          <gxsl:when test="@oncreate='show'">
          <!--
            <b><font size="-1"><gxsl:value-of select="Title"/>: <gxsl:if test="@mandat='1'"><span class="mandat">* </span></gxsl:if>
            </font></b>
            <font size="-2"><xsl:text disable-output-escaping="yes"><gxsl:value-of select="Descr"/></xsl:text></font>
            <br/>
            -->
            <span>
              <gxsl:call-template name="tooltip"><gxsl:with-param name="title" select="Title"/><gxsl:with-param name="desc" select="Descr"/></gxsl:call-template>
              <b>
                <font size="-1">
                  <nobr><label for="{@formcode}"><gxsl:value-of select="Title"/></label>:<gxsl:if test="@mandat='1' and @type!='boolean' and @type!='boolean_txt'"><span class="mandat" title="{$dict/Text[@tid='mandat_tooltip']/Value[@lang=$lang]}"> * </span></gxsl:if></nobr>
                </font>
              </b>
            </span>
            <gxsl:if test="Descr and Descr!=''">
              <xsl:if test="$ulevel='beg'">
                <br/>
                <font size="-2">
                  <gxsl:value-of select="Descr"/>
                </font>
              </xsl:if>
            </gxsl:if>
            <gxsl:text disable-output-escaping="yes">&lt;/td&gt;&lt;td valign="top"&gt;</gxsl:text>
            <gxsl:choose>
              <gxsl:when test="CPStaticValues">
                <select size="1" name="{@formcode}" class="input_field" onchange='changed();'>
                  <option value="">--- <gxsl:value-of select="$dict/Text[@tid='choose_one']/Value[@lang=$lang]"/> ---</option>
                  <gxsl:for-each select="CPStaticValues/CPStaticValue">
                    <option value='{statval}'>
                      <gxsl:if test="statval=$default">
                        <gxsl:attribute name="selected">yes</gxsl:attribute>
                      </gxsl:if>
                      <gxsl:value-of select="title"/>
                    </option>
                  </gxsl:for-each>
                </select>
              </gxsl:when>
              <gxsl:when test="@fetchtype='direct' and @ref and @ref!=''">
                <select size="1" name="{@formcode}" class="input_field" onchange='changed();'>
                  <option value="">--- <gxsl:value-of select="$dict/Text[@tid='choose_one']/Value[@lang=$lang]"/> ---</option>
                  <xsl:for-each select="{@refconceptcoll}/{@refconcept}">
                    <option>
                      <gxsl:choose>
                        <gxsl:when test="@attr='1'">
                          <xsl:attribute name="value"><xsl:value-of select="@{@refproplow}"/></xsl:attribute>
                        </gxsl:when>
                        <gxsl:otherwise>
                          <xsl:attribute name="value"><xsl:value-of select="{@refprop}"/></xsl:attribute>
                        </gxsl:otherwise>
                      </gxsl:choose>
                      <gxsl:choose>
                        <gxsl:when test="@attr='1'">
                          <xsl:if test="@{@refproplow}='{$default}'">
                            <xsl:attribute name="selected">yes</xsl:attribute>
                          </xsl:if>
                        </gxsl:when>
                        <gxsl:otherwise>
                          <xsl:if test="{@refprop}='{$default}'">
                            <xsl:attribute name="selected">yes</xsl:attribute>
                          </xsl:if>
                        </gxsl:otherwise>
                      </gxsl:choose>
                      <gxsl:choose>
                        <gxsl:when test="RefProp">
                          <gxsl:for-each select="RefProp">
                            <gxsl:choose>
                              <gxsl:when test="@attr='1'">
                                <xsl:value-of select="@{@lowcode}"/><gxsl:if test="position()!=last()">,&#160;</gxsl:if>
                              </gxsl:when>
                              <gxsl:otherwise>
                                <xsl:value-of select="{@code}"/><gxsl:if test="position()!=last()">,&#160;</gxsl:if>
                              </gxsl:otherwise>
                            </gxsl:choose>
                          </gxsl:for-each>
                        </gxsl:when>
                        <gxsl:otherwise>
                          <xsl:value-of select="@{@refproplow}"/>
                        </gxsl:otherwise>
                      </gxsl:choose>
                    </option>
                  </xsl:for-each>
                </select>
              </gxsl:when>

              <gxsl:when test="@fetchtype='external' and @ref and @ref!='' and @extwork and @extwork!=''">
                <gxsl:variable name="position"><gxsl:value-of select="position()"/></gxsl:variable>
                <input type="hidden" value="{$default}" name="{@formcode}"/>
                <input type="hidden" value="{$default}" name="{@formcode}xarray"/>
                <input class="external_selection_key" readonly="true" type="text" value="{$default}" size="{$lenvis}">
                  <gxsl:attribute name="name">label<gxsl:value-of select="position()"/></gxsl:attribute>
                </input>
                <input type="button" class="input_button"><gxsl:attribute name="value"><gxsl:value-of select="$dict/Text[@tid='select']/Value[@lang=$lang]"/></gxsl:attribute>
                  <gxsl:attribute name="onclick">add<gxsl:value-of select="position()"/>();</gxsl:attribute>
                </input>

                <gxsl:for-each select="../../CVICGroups/CVICGroup/CVIConditions/CVICondition[@type='ext' and @property=current()/@name and not(contains(@val,'='))]">
                  <input type="text" name="ext{position()}" size="3"/>
                </gxsl:for-each>

                <script language="JavaScript" type="text/javascript">
                  <!--<xsl:comment>-->
                    <![CDATA[
                      function add]]><gxsl:value-of select="position()"/><![CDATA[()
                      {
                        var f=document.edit;

                        ]]><gxsl:choose>
                          <gxsl:when test="@key='0' and not(../../CVIProperties/CVIProperty[@key='1' and @cntr='1'])"><![CDATA[
                        var path="../]]><xsl:value-of select="substring-before(/DPOutput/@package,'.')"/>.<gxsl:value-of select="@extwork"/>/?select=<gxsl:value-of select="@formcode"/>&amp;ssnctl=hdrext&amp;allowmulti=0<![CDATA[";
                        ]]></gxsl:when>
                          <gxsl:otherwise><![CDATA[
                        var path="../]]><xsl:value-of select="substring-before(/DPOutput/@package,'.')"/>.<gxsl:value-of select="@extwork"/>/?select=<gxsl:value-of select="@formcode"/>&amp;ssnctl=hdrext&amp;allowmulti=<gxsl:choose><gxsl:when test="not(@allowmulti) or @allowmulti='1'">1</gxsl:when><gxsl:otherwise>0</gxsl:otherwise></gxsl:choose><![CDATA[";
                        ]]></gxsl:otherwise>
                        </gxsl:choose><![CDATA[

                        ]]><gxsl:if test="../../CVICGroups/CVICGroup/CVIConditions/CVICondition[@type='ext' and @property=current()/@name]">
                          path+="&amp;filter=&lt;DPFilter>";
                          <gxsl:for-each select="../../CVICGroups/CVICGroup/CVIConditions/CVICondition[@type='ext' and @property=current()/@name and contains(@val,'=')]">
                            path+="&lt;<gxsl:value-of select="@operator"/>%20property%3d\"<gxsl:value-of select="substring-after(@val,'=')"/>\"%20default%3d\"";
                            <gxsl:choose>
                              <gxsl:when test="starts-with(substring-before(@val,'='),'&quot;')">
                                path+="<gxsl:value-of select="substring-after(substring-before(@val,'&quot;='),'&quot;')"/>";
                              </gxsl:when>
                              <gxsl:otherwise>
                                path+="<xsl:value-of select="/DPOutput/DPNavig/{substring-before(@val,'=')}"/>";
                              </gxsl:otherwise>
                            </gxsl:choose>
                            path+="\"/>";
                          </gxsl:for-each>
                          <gxsl:for-each select="../../CVICGroups/CVICGroup/CVIConditions/CVICondition[@type='ext' and @property=current()/@name and not(contains(@val,'='))]">
                            path+="&lt;<gxsl:value-of select="@operator"/>%20property%3d\"<gxsl:value-of select="@val"/>\"%20default%3d\""+document.edit<gxsl:value-of select="position()"/>.value+"\"/>";
                          </gxsl:for-each>path+="&lt;/DPFilter>";
                        </gxsl:if><![CDATA[

                        var sFeatures = "dependent=yes,toolbar=no,scrollbars=yes,location=no,status=no,resizable=yes,height="+document.body.clientHeight+",width="+document.body.clientWidth+",top="+window.screenTop+",left="+window.screenLeft;
                        window.open(path,"external",sFeatures);
                      }

                      function ]]><gxsl:value-of select="@formcode"/><![CDATA[(key, defaults]]><gxsl:for-each select="RefProp">, reflabel<gxsl:value-of select="$position"/>_<gxsl:value-of select="position()"/></gxsl:for-each><![CDATA[)
                      {
                        var f=document.edit;
                        f.]]><gxsl:value-of select="@formcode"/><![CDATA[xarray.value=key;
                        f.]]><gxsl:value-of select="@formcode"/><![CDATA[.value='0';
                        f.ssnctl.value="hdrnrm";
                        f.label]]><gxsl:value-of select="position()"/><![CDATA[.value=key;

                        ]]><gxsl:for-each select="../CVIProperty[@defaulttype='ext' and @extwork=current()/@extwork]">
                        f.<gxsl:value-of select="@formcode"/>.value=defaults.<gxsl:value-of select="translate(@default,'.','_')"/>;
                        </gxsl:for-each><![CDATA[

                        changed();
                    ]]>

                    <gxsl:for-each select="RefProp">
                    <![CDATA[
                        f.reflabel]]><gxsl:value-of select="$position"/>_<gxsl:value-of select="position()"/><![CDATA[.value=reflabel]]><gxsl:value-of select="$position"/>_<gxsl:value-of select="position()"/><![CDATA[;

                    ]]>
                    </gxsl:for-each>

                    <![CDATA[
                        window.focus();
                      }

                      function ]]><gxsl:value-of select="@formcode"/><![CDATA[multi(keys) {]]>
                          <gxsl:if test="@key='0' and not(../../CVIProperties/CVIProperty[@key='1' and @cntr='1'])"><![CDATA[
                            alert('The concept has no generated key and this property is not key!');
                            return;]]>
                          </gxsl:if><![CDATA[
                        var f = document.edit;
                        f.]]><gxsl:value-of select="@formcode"/><![CDATA[xarray.value = keys;
                        f.]]><gxsl:value-of select="@formcode"/><![CDATA[.value = '0';
                        f.ssnctl.value = "hdrnrm";
                        f.label]]><gxsl:value-of select="position()"/><![CDATA[.value = "multi";
                        changed();
                    ]]>

                    <gxsl:for-each select="RefProp">
                    <![CDATA[
                        f.reflabel]]><gxsl:value-of select="$position"/>_<gxsl:value-of select="position()"/><![CDATA[.value = "n/a";

                    ]]>
                    </gxsl:for-each>

                    <![CDATA[
                        window.focus();
                      }


                    ]]>
                  <!--//</xsl:comment>-->
                </script>
                <br/>

                <table>
                <gxsl:for-each select="RefProp">
                  <tr>
                    <td>
                      &#160;&#160;&#160;&#160;&#160;<b><font size="-1"><gxsl:value-of select="Title"/>:</font></b>&#160;
                    </td>
                    <td>
                      <input class="external_selection" readonly="true" type="text" value="" size="{$lenvis}" onkeyup='changed();'>
                        <gxsl:attribute name="name">reflabel<gxsl:value-of select="$position"/>_<gxsl:value-of select="position()"/></gxsl:attribute>
                        <gxsl:attribute name="size"><gxsl:choose><gxsl:when test="@len &gt; 60">60</gxsl:when><gxsl:otherwise><gxsl:value-of select="@len"/></gxsl:otherwise></gxsl:choose></gxsl:attribute>
                      </input>
                    </td>
                  </tr>
                </gxsl:for-each>
                </table>
              </gxsl:when>

              <gxsl:when test="@type='password'">
                <input class="input_field" type="password" name="{@formcode}" value="{$default}" size="{$lenvis}" onkeyup='changed();'/>
              </gxsl:when>

              <gxsl:when test="@type='boolean' and @mandat='1'">
                <input name="{@formcode}" id="{@formcode}" type="hidden" value="{$default}"/>
                <input type="checkbox" onclick="{@formcode}.value = ({@formcode}.value == 0 ? 1 : 0); changed();">
                  <gxsl:if test="$default='1'">
                    <xsl:attribute name="checked">true</xsl:attribute>
                  </gxsl:if>
                </input>
              </gxsl:when>

              <gxsl:when test="@type='boolean_txt' and @mandat='1'">
                <input name="{@formcode}" id="{@formcode}" type="hidden" value="{$default}"/>
                <input type="checkbox" onclick="{@formcode}.value = ({@formcode}.value == 'false' ? 'true' : 'false'); changed();">
                  <gxsl:if test="$default='true'">
                    <xsl:attribute name="checked">true</xsl:attribute>
                  </gxsl:if>
                </input>
              </gxsl:when>

              <gxsl:when test="@type='boolean'">
                <font size="-1">
                <label for="{@formcode}_true"><gxsl:value-of select="$dict/Text[@tid='Yes']/Value[@lang=$lang]"/></label><xsl:text> </xsl:text><input type="radio" name="{@formcode}" id="{@formcode}_true" value="1" onchange='changed();' onclick='changed();'>
                  <gxsl:if test="$default='1'"><gxsl:attribute name="checked">yes</gxsl:attribute></gxsl:if>
                </input>
                <label for="{@formcode}_false"><gxsl:value-of select="$dict/Text[@tid='No']/Value[@lang=$lang]"/></label><xsl:text> </xsl:text><input type="radio" name="{@formcode}" id="{@formcode}_false" value="0" onchange='changed();' onclick='changed();'>
                  <gxsl:if test="$default='0' or ($default!='1' and @mandat='1')"><gxsl:attribute name="checked">yes</gxsl:attribute></gxsl:if>
                </input>
                <gxsl:if test="@mandat!='1'">
                  <label for="{@formcode}_null"><gxsl:value-of select="$dict/Text[@tid='Unspecified']/Value[@lang=$lang]"/></label><xsl:text> </xsl:text><input type="radio" name="{@formcode}" id="{@formcode}_null" value="" onchange='changed();' onclick='changed();'>
                    <gxsl:if test="not($default) or ($default!='0' and $default!='1')"><gxsl:attribute name="checked">yes</gxsl:attribute></gxsl:if>
                  </input>
                </gxsl:if>
                </font>
              </gxsl:when>

              <gxsl:when test="@type='boolean_txt'">
                <font size="-1">
                <label for="{@formcode}_true"><gxsl:value-of select="$dict/Text[@tid='Yes']/Value[@lang=$lang]"/></label><xsl:text> </xsl:text><input type="radio" name="{@formcode}" id="{@formcode}_true" value="true" onchange='changed();' onclick='changed();'>
                  <gxsl:if test="$default='true'"><gxsl:attribute name="checked">yes</gxsl:attribute></gxsl:if>
                </input>
                <label for="{@formcode}_false"><gxsl:value-of select="$dict/Text[@tid='No']/Value[@lang=$lang]"/></label><xsl:text> </xsl:text><input type="radio" name="{@formcode}" id="{@formcode}_false" value="false" onchange='changed();' onclick='changed();'>
                  <gxsl:if test="$default='false' or (@mandat='1' and $default!='true')"><gxsl:attribute name="checked">yes</gxsl:attribute></gxsl:if>
                </input>
                <gxsl:if test="@mandat!='1'">
                  <label for="{@formcode}_null"><gxsl:value-of select="$dict/Text[@tid='Unspecified']/Value[@lang=$lang]"/></label><xsl:text> </xsl:text><input type="radio" name="{@formcode}" id="{@formcode}_null" value="" onchange='changed();' onclick='changed();'>
                    <gxsl:if test="not($default) or ($default!='false' and $default!='true')"><gxsl:attribute name="checked">yes</gxsl:attribute></gxsl:if>
                  </input>
                </gxsl:if>
                </font>
              </gxsl:when>

              <gxsl:when test="@type='url'">

                <gxsl:variable name="urlsource">
                  <gxsl:value-of select="$default"/>
                </gxsl:variable>

                <gxsl:variable name="urlsource" select="substring-after($urlsource,'&lt;a href=&quot;')"/>

                <gxsl:variable name="urlpart">
                  <gxsl:choose>
                    <gxsl:when test="starts-with($urlsource,'http://')">
                      <gxsl:value-of select="'http://'"/>
                    </gxsl:when>
                    <gxsl:when test="starts-with($urlsource,'https://')">
                      <gxsl:value-of select="'https://'"/>
                    </gxsl:when>
                    <gxsl:when test="starts-with($urlsource,'ftp://')">
                      <gxsl:value-of select="'ftp://'"/>
                    </gxsl:when>
                    <gxsl:when test="starts-with($urlsource,'mailto:')">
                      <gxsl:value-of select="'mailto:'"/>
                    </gxsl:when>
                    <gxsl:when test="starts-with($urlsource,'file:///')">
                      <gxsl:value-of select="'mailto:'"/>
                    </gxsl:when>
                    <gxsl:otherwise>
                      <gxsl:value-of select="''"/>
                    </gxsl:otherwise>
                  </gxsl:choose>
                </gxsl:variable>

                <font size="-2"><gxsl:value-of select="$dict/Text[@tid='prot']/Value[@lang=$lang]"/>&#160;</font>
                <select size="1" class="input_field" name="{@formcode}_proto">
                  <gxsl:attribute name="onchange">composeurl<gxsl:value-of select="position()"/>();</gxsl:attribute>
                  <gxsl:attribute name="name"><gxsl:value-of select="concat(@formcode,'xprotocol')"/></gxsl:attribute>
                  <option value="">
                    <gxsl:if test="not($default) or $default=''">
                      <gxsl:attribute name="selected">yes</gxsl:attribute>
                    </gxsl:if>
                  </option>
                  <option value="http://">
                    <gxsl:if test="$urlpart='http://'">
                      <gxsl:attribute name="selected">yes</gxsl:attribute>
                    </gxsl:if>
                    http://
                  </option>
                  <option value="https://">
                    <gxsl:if test="$urlpart='https://'">
                      <gxsl:attribute name="selected">yes</gxsl:attribute>
                    </gxsl:if>
                    https://
                  </option>
                  <option value="ftp://">
                    <gxsl:if test="$urlpart='ftp://'">
                      <gxsl:attribute name="selected">yes</gxsl:attribute>
                    </gxsl:if>
                    ftp://
                  </option>
                  <option value="mailto:">
                    <gxsl:if test="$urlpart='mailto:'">
                      <gxsl:attribute name="selected">yes</gxsl:attribute>
                    </gxsl:if>
                    mailto:
                  </option>
                  <option value="file:///">
                    <gxsl:if test="$urlpart='file:///'">
                      <gxsl:attribute name="selected">yes</gxsl:attribute>
                    </gxsl:if>
                    file:///
                  </option>
                </select>

                <gxsl:variable name="urlsource" select="substring-after($urlsource,$urlpart)"/>

                <font size="-2">&#160;&#160;<gxsl:value-of select="$dict/Text[@tid='link']/Value[@lang=$lang]"/>&#160;</font>
                <input class="input_field" type="text" size="30" name="{@formcode}_src">
                  <gxsl:attribute name="onkeyup">composeurl<gxsl:value-of select="position()"/>();</gxsl:attribute>
                  <gxsl:attribute name="name"><gxsl:value-of select="concat(@formcode,'xaddress')"/></gxsl:attribute>
                  <gxsl:attribute name="value"><gxsl:value-of select="substring-before($urlsource,'&quot;&gt;')"/></gxsl:attribute>
                </input>

                <gxsl:variable name="urlsource" select="substring-before(substring-after($urlsource,'&quot;&gt;'),'&lt;/a&gt;')"/>

                <font size="-2">&#160;&#160;<gxsl:value-of select="$dict/Text[@tid='descr']/Value[@lang=$lang]"/>&#160;</font>
                <input class="input_field" type="text" size="30" name="{@formcode}_desc">
                  <gxsl:attribute name="onkeyup">composeurl<gxsl:value-of select="position()"/>();</gxsl:attribute>
                  <gxsl:attribute name="name"><gxsl:value-of select="concat(@formcode,'xcomment')"/></gxsl:attribute>
                  <gxsl:attribute name="value"><gxsl:value-of select="$urlsource"/></gxsl:attribute>
                </input>

                <br/>

                <gxsl:if test="$default and $default!=''">
                  <font size="-1">url - <b><gxsl:value-of select="$default" disable-output-escaping="yes"/></b></font><br/>
                </gxsl:if>
                <input class="input_field" type="hidden" name="{@formcode}" value="{$default}" size="{$lenvis}" onkeyup='changed();'/>

                <script language="JavaScript" type="text/javascript">
                  <xsl:comment>

                    <![CDATA[

                      function composeurl]]><gxsl:value-of select="position()"/><![CDATA[()
                      {

                        changed();

                        var form = document.forms.edit;

                        form.]]><gxsl:value-of select="@formcode"/><![CDATA[.value='<a href="'+form.]]><gxsl:value-of select="concat(@formcode,'xprotocol')"/><![CDATA[.value+form.]]><gxsl:value-of select="concat(@formcode,'xaddress')"/><![CDATA[.value+'">';

                        if (form.]]><gxsl:value-of select="concat(@formcode,'xcomment')"/><![CDATA[.value=='') {
                          form.]]><gxsl:value-of select="@formcode"/><![CDATA[.value+=form.]]><gxsl:value-of select="concat(@formcode,'xprotocol')"/><![CDATA[.value+form.]]><gxsl:value-of select="concat(@formcode,'xaddress')"/><![CDATA[.value+'</a>';
                        } else {
                          form.]]><gxsl:value-of select="@formcode"/><![CDATA[.value+=form.]]><gxsl:value-of select="concat(@formcode,'xcomment')"/><![CDATA[.value+'</a>';
                        }

                        if (form.]]><gxsl:value-of select="@formcode"/><![CDATA[.value=='<a href=""></a>') {
                          form.]]><gxsl:value-of select="@formcode"/><![CDATA[.value=' ';
                        }

                      }
                    ]]>

                  //</xsl:comment>
                </script>

              </gxsl:when>

              <gxsl:otherwise>
                <input class="input_field" type="text" name="{@formcode}" value="{$default}" size="{$lenvis}" onkeyup='changed();'/>
              </gxsl:otherwise>
            </gxsl:choose>
          </gxsl:when>

          <gxsl:when test="@key='1' or ../../../CVIRBindings/CVIRBinding[@p2=current()/@name]">
            <gxsl:choose>
              <gxsl:when test="@defaulttype='ref'">
                <input type="hidden" name="{@formcode}"/>
              </gxsl:when>
              <gxsl:when test="../../../CVIRBindings/CVIRBinding[@p2=current()/@name]">
                <input type="hidden" name="{@formcode}" value="{{../DPNavig/{../../../../../@conceptcoll}/{../../../../../@concept}/@{../../../CVIRBindings/CVIRBinding[@p2=current()/@name]/@p1low}}}"/>
              </gxsl:when>
              <gxsl:otherwise>
                <input type="hidden" name="{@formcode}" value="{$default}"/>
              </gxsl:otherwise>
            </gxsl:choose>
            <gxsl:if test="@oncreate='grey'">
            <!--
              <b><font size="-1"><gxsl:value-of select="Title"/>: <gxsl:if test="@mandat='1'"><span class="mandat">* </span></gxsl:if>
              </font></b>
              <font size="-2"><xsl:text disable-output-escaping="yes"><gxsl:value-of select="Descr"/></xsl:text></font>
              <br/>
            -->
              <span>
                <gxsl:call-template name="tooltip"><gxsl:with-param name="title" select="Title"/><gxsl:with-param name="desc" select="Descr"/></gxsl:call-template>
                <b>
                  <font size="-1">
                  <nobr><gxsl:value-of select="Title"/>:<gxsl:if test="@mandat='1' and @type!='boolean' and @type!='boolean_txt'"><span class="mandat" title="{$dict/Text[@tid='mandat_tooltip']/Value[@lang=$lang]}"> * </span></gxsl:if></nobr>
                  </font>
                </b>
              </span>
              <gxsl:if test="Descr and Descr!=''">
                <xsl:if test="$ulevel='beg'">
                  <br/>
                  <font size="-2">
                    <gxsl:value-of select="Descr"/>
                  </font>
                </xsl:if>
              </gxsl:if>
              <gxsl:text disable-output-escaping="yes">&lt;/td&gt;&lt;td valign="top"&gt;</gxsl:text>
              <gxsl:choose>
                <gxsl:when test="../../../CVIRBindings/CVIRBinding[@p2=current()/@name]">
                  <xsl:value-of select="../DPNavig/{../../../../../@conceptcoll}/{../../../../../@concept}/@{../../../CVIRBindings/CVIRBinding[@p2=current()/@name]/@p1low}"/>
                </gxsl:when>
                <gxsl:otherwise>
                  <gxsl:value-of select="$default"/>
                </gxsl:otherwise>
              </gxsl:choose>
            </gxsl:if>
          </gxsl:when>

          <gxsl:when test="@oncreate='grey'">
          <!--
            <b><font size="-1"><gxsl:value-of select="Title"/>: <gxsl:if test="@mandat='1'"><span class="mandat">* </span></gxsl:if>
            </font></b>
            <font size="-2"><xsl:text disable-output-escaping="yes"><gxsl:value-of select="Descr"/></xsl:text></font>
            <br/>
          -->
            <span>
              <gxsl:call-template name="tooltip"><gxsl:with-param name="title" select="Title"/><gxsl:with-param name="desc" select="Descr"/></gxsl:call-template>
              <b>
                <font size="-1">
                    <nobr><gxsl:value-of select="Title"/>:<gxsl:if test="@mandat='1' and @type!='boolean' and @type!='boolean_txt'"><span class="mandat" title="{$dict/Text[@tid='mandat_tooltip']/Value[@lang=$lang]}"> * </span></gxsl:if></nobr>
                </font>
              </b>
            </span>
            <gxsl:if test="Descr and Descr!=''">
              <xsl:if test="$ulevel='beg'">
                <br/>
                <font size="-2">
                  <gxsl:value-of select="Descr"/>
                </font>
              </xsl:if>
            </gxsl:if>
            <gxsl:text disable-output-escaping="yes">&lt;/td&gt;&lt;td valign="top"&gt;</gxsl:text>
            <input type="hidden" name="{@formcode}" value="{$default}"/>
            <gxsl:value-of select="$default"/>
          </gxsl:when>

          <gxsl:otherwise>
            <input type="hidden" name="{@formcode}" value="{$default}"/>
          </gxsl:otherwise>
        </gxsl:choose>

        <gxsl:if test="@type='file'">
          <input type="button" name="selectfile" value="Select" onclick="window.open('{{concat(/DPOutput/@cpath,'/sta/',/DPOutput/@repository,'/fckeditor/editor/filemanager/browser/default/browser.html?Type={@default}&amp;Connector=',/DPOutput/@cpath,'/fbrowse')}}', '_blank')"/>
          <script language="JavaScript" type="text/javascript">
            <xsl:comment>
              <![CDATA[
                function SetUrl(url)
                {
                  document.forms.edit.]]><gxsl:value-of select="@formcode"/><![CDATA[.value = url;
                }
              ]]>
            </xsl:comment>
          </script>
        </gxsl:if>

        </td></tr>
      </gxsl:for-each>
      </table>
      <!--<gxsl:text disable-output-escaping="yes">&lt;/tr&gt; &lt;/table&gt;</gxsl:text>-->

      <gxsl:variable name="first">
        <gxsl:value-of select="CVIProperties/CVIProperty[@oncreate='show' and ../../@create='1' and not(@ref and @ref!='')]/@formcode"/>
      </gxsl:variable>

      <gxsl:if test="$first!=''">
        <script>  
          try {
            <gxsl:choose>
              <gxsl:when test="@type='url'">
                document.edit.<gxsl:value-of select="$first"/>_proto.focus();              
              </gxsl:when>
              <gxsl:when test="starts-with(@type, 'boolean') and @mandat='0'">
                document.edit.<gxsl:value-of select="$first"/>[1].focus();                            
              </gxsl:when>
              <gxsl:otherwise>
                document.edit.<gxsl:value-of select="$first"/>.focus();              
              </gxsl:otherwise>
            </gxsl:choose>
          } catch (e) {}          
        </script>
      </gxsl:if>
      
      </xsl:template>

      <xsl:template name="title"><gxsl:value-of select="ancestor::CView/CVTitles/CVTitle/Title"/></xsl:template>

  </gxsl:template>

</gxsl:stylesheet>
